<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * 服务中心
 * @author apple
 *
 */
class Service extends CT_Controller
{

    public function __construct()
    {
        parent::__construct();
    }

    /**
     * 首页
     */
    public function index()
    { 
        $this->load->model('member_model');
        $this->load->model('teacher_model');
        
        $data['is_login'] = $this->_uid ? 1 : 0;
        
        if($data['is_login'] && $this->_is_teacher){
            $data['info'] = $this->teacher_model->find(array('id'=>$this->_uid));
        }
        
        if($data['is_login'] && !$this->_is_teacher){
            $data['info'] = $this->member_model->find(array('id'=>$this->_uid));
        }
        
        $this->ct_template->write('_title', '服务中心');
        $this->ct_template->write_view('content', 'service/index', $data, FALSE);
        $this->ct_template->render();
    }
    
    /**
     * 用户协议
     */
    public function protocol()
    {
        $this->ct_template->write('_title', '用户协议');
        $this->ct_template->write_view('content', 'service/protocol', array(), FALSE);
        $this->ct_template->render();
    }
    
    /**
     * 关于我们
     */
    public function about()
    {
        $this->ct_template->write('_title', '关于我们');
        $this->ct_template->write_view('content', 'service/about', array(), FALSE);
        $this->ct_template->render();
    }
    
    /**
     * 服务流程
     */
    public function process()
    {
        $this->ct_template->write('_title', '服务流程');
        $this->ct_template->write_view('content', 'service/process', array(), FALSE);
        $this->ct_template->render();
    }

}
